This is a script for manipulating with sections/masterpages.
Please refer to the documentation for more detail.
This script is a DEMO version, not full vrsion. You may copy it
to anybody. It is not for your personal use only.
If you found a bug in the script, let me know. All bug fixes and
updates are free for the registered users
If you would like something to say, e-mail is: ffpecjak@uni-lj.si
*/
options results;showmessage 2 0 '"This script will heavily modify your document!!!" "We recommend that you save it first" "" "Proceed" "Save" "Exit"';if result=3 then exit;if result=2 then saveas;showmessage 1 0 '"In which commands are you interested?" "" "" "Sections" "Master Page" ""';if result=1 then poglavje=1;else poglavje=2;if poglavje=1 then;do;showmessage 1 0 '"Add/Del, Move/Copy or Swap sections?" "" "" "Add/Del" "Move/Copy" "Swap"';if result=1 then naredi=1;if result=2 then naredi=2;if result=3 then naredi=3;add=3;if naredi=1 then;do;showmessage 1 0 '"Add or Delete Section?" "" "" "Add" "Delete" ""';if result=1 then add=1;if result=2 then add=0;if add=0 then call shareware;if add=1 then call dodajpoglavje;end;call naredispisek;if add=1 then call dodaj;if naredi=2 then;do;showmessage 1 0 '"MOVE or COPY section?" "" "" "Move" "Copy" "Exit"';if result=3 then exit;if result=1 then call shareware;if result=2 then call shareware;end;if naredi=3 then call shareware;end;if poglavje=2 then;do;showmessage 1 0 '"What do you want to do with masterpages?" "" "" "Copy" "Move" "Swap"';if result=1 then naredi=1;if result=2 then naredi=2;if result=3 then naredi=3;if naredi=1 then;do;kopiraj=1;call delozmasterji;end;if naredi=2 then call shareware;if naredi=3 then call shareware;end;EXIT;Damjana:;Graphictool;FirstObject;stevec=0;do until result=0;objectid=result;stevec=stevec+1;setobjectparams objectid LINKED samopot.stevec;selectobject objectid;x=x.stevec;y=y.stevec;visina=visina.stevec;sirina=sirina.stevec;stran=stran.stevec;setobjectcoords objectid stran x y visina sirina;redraw;NextObject objectid;end;redraw;return;Damjanafix:;FirstObject selected;stevec=0;do until result=0;objectid=result;stevec=stevec+1;objectid.stevec=objectid;NextObject objectid SELECTED;end;do haj=1 for stevec;selectobject objectid.haj;getobjectcoords 0;PARSE VAR Result stran x y visina sirina;x=x-0.3175;y=y-0.3175;setobjectcoords 0 stran x y visina sirina;end;redraw;return;Damjana1:;stevec=0;GraphicTool;FirstObject;niobjekta=result;do until result=0;stevec=stevec+1;objectid=result;getobjectparams objectid LINKED;samopot.stevec=result;getobjectcoords objectid;parse var Result stran x y visina sirina;stran.stevec=stran;x.stevec=x;y.stevec=y;visina.stevec=visina;sirina.stevec=sirina;NextObject objectid;end;FirstObject;niobjekta=result;do until result=0;objectid=result;SelectObject objectid MULTIPLE;NextObject objectid;end;redraw;return niobjekta;PopraviGfx:;call bodymaster;call desnimaster;call levimaster;return;DesniMaster:;gotosection spisek.i;editrightmaster;Damjana1();cut;gotosection spisek.j;editrightmaster;if niobjekta>0 then;do;paste;call Damjana;end;return;LeviMaster:;gotosection spisek.i;editleftmaster;Damjana1();cut;gotosection spisek.j;editleftmaster;if niobjekta>0 then;do;paste;call Damjana;end;return;Bodymaster:;gotosection spisek.i;Damjana1();cut;gotosection spisek.j;if niobjekta>0 then;do;paste;call damjana;end;return;dodaj:;stspiskov=i;i=1;getsectionsetup NAME;imepoglavja='"'||result||'"';if spisek.i=imepoglavja then abk=1;else abk=0;if abk=0 then;do;do until spisek.i=imepoglavja;niobjekta=1;i=i+1;j=i-1;call popravigfx;end;gotosection imepoglavja;editbody;end;return;dodajpoglavje:;requesttext '"Name the section!" "" "Main"';ime='"'||result||'"';showmessage 1 0 '"Do you want to insert it AFTER or BEFORE" "the current section?" "" "AFTER" "BEFORE" ""';if result=1 then potem=1;if result=2 then potem=0;if potem=1 then NewSection text name ime after;if potem=0 then NewSection text name ime before;return;naredispisek:;getsectionlist ".";spisek=result;i=0;newspisek=1;do until newspisek=0;i=i+1;odrezi=lastpos('.',spisek);dolzina=length(spisek);if odrezi=0 then odrezi= dolzina;newspisek= dolzina-odrezi;if newspisek=0 then spisek.i='"'||right(spisek, dolzina)||'"';else spisek.i='"'||right(spisek,newspisek)||'"';spisek= delstr(spisek,odrezi);end;return;testnacin:;if nacin=1 then editbody;if nacin=2 then editrightmaster;if nacin=3 then editleftmaster;return;delozmasterji:;showmessage 1 0 '"Copy what?" "" "" "L->R" "R->L" "Between"';if result=1 then;do;kaj=1;showmessage 1 0 '"Delete right master?" "" "" "Yes" "No" ""';if result=1 then call brisidesnimaster;odkod=levi;kam= desni;between=0;call kopirajmaster;end;if result=2 then call shareware;if result=3 then call shareware;return;zbrisidestination:;showmessage 1 0 '"Delete destination before " "copy/move?" "" "Yes" "No" ""';if result=1 then;do;gotosection imekam;if kam=levi then call brisilevimaster;else call brisidesnimaster;end;return;shareware:;showmessage 1 0 '"You must register yourself" "for this function to work!!" "" "I see" "" ""';exit;return;kopirajmaster:;if between=1 then gotosection imeodkod;if odkod=levi then editleftmaster;else editrightmaster;texttool;selectall;extract;if result>"" then nare=1;else nare=0;selectall;if nare=1 then;do;cut;paste;if kopiraj=0 then cut;end;else copy;redraw;if between=1 then gotosection imekam;if kam=levi then editleftmaster;else editrightmaster;if nare=1 then paste;if between=1 then gotosection imeodkod;if odkod=levi then editleftmaster;else editrightmaster;graphictool;damjana1();if kopiraj=1 then copy;else cut;if between=1 then gotosection imekam;if kam=levi then editleftmaster;else editrightmaster;if niobjekta>0 then;do;paste;call damjanafix;end;editbody;return